import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { connect } from '@tarojs/redux'
import { setSearchPage } from '../../actions/AcSearchFc'
// 组件
import { SearchBar } from '../../components/searchBar/searchBar'
import { FilterBar } from '../../components/filter/filterBar'
import { SearchPage } from '../../components/searchPage/searchPage'
 
import './index.less'


@connect(({ searchFc }) => ({
  searchFc
}), (dispatch) => ({
  setSearchPage () {
    dispatch(setSearchPage())
  }
}))
class Index extends Component {
    config = {
    navigationBarTitleText: '拍卖'
  }
  getSearchInfo(){
    console.log(this.props)
    // eslint-disable-next-line taro/this-props-function
    this.props.setSearchPage&&this.props.setSearchPage()
  }
  componentWillReceiveProps (nextProps) {
    console.log(this.props, nextProps)
  }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    // isshowPositionPage
    return (
      <View className='index'>
        <SearchBar searchBarOut={this.getSearchInfo.bind(this)}></SearchBar>
        <FilterBar></FilterBar>
        <SearchPage></SearchPage>
      </View>
    )
  }
}

export default Index
